﻿using HiSportApplet.Core.Enum;
using SqlSugar;
using System.ComponentModel.DataAnnotations;


namespace HiSportApplet.Core.Entity.Orders
{

    /// <summary>
    ///预定场地主表
    /// </summary>
    [SugarTable(null, "订场订单主表")]
    public class OrderSite : EntityBase
    {
        /// <summary>
        /// 场馆ID
        /// </summary>
        [SugarColumn(ColumnDescription = "场馆ID")]
        public long  VenuesId { get; set; }

        /// <summary>
        /// 创建者部门Id
        /// </summary>
        [SugarColumn(ColumnDescription = "创建者部门Id")]
        public virtual long? OrgId { get; set; }

        /// <summary>
        /// 订单编号
        /// </summary>
        [SugarColumn(ColumnDescription = "订单编号", DefaultValue = "", IsNullable = false)]
        [MaxLength(100)]
        public string OrderNum { get; set; }

        /// <summary>
        /// 预定时间  
        /// </summary>
        [SugarColumn(ColumnDescription = "预定时间", IsNullable = false)]
        public DateTime ScheduledTime { get; set; }


        /// <summary>
        /// 场地类型
        /// </summary>
        [SugarColumn(ColumnDescription = "场地类型", DefaultValue = "", IsNullable = false)]
        public long SiteTypeId { get; set; }


        /// <summary>
        /// 会员ID
        /// </summary>
        [SugarColumn(ColumnDescription = "会员ID", DefaultValue = "0", IsNullable = false)]
        public long MemberId { get; set; }

        /// <summary>
        /// 会员名称
        /// </summary>
        [SugarColumn(ColumnDescription = "会员名称", DefaultValue = "", IsNullable = false)]
        [MaxLength(20)]
        public string MemberName { get; set; }

        /// <summary>
        /// 会员电话
        /// </summary>
        [SugarColumn(ColumnDescription = "会员电话", DefaultValue = "", IsNullable = false)]
        [MaxLength(20)]
        public string Phone { get; set; }



        /// <summary>
        /// 订单总金额
        /// </summary>
        [SugarColumn(ColumnDescription = "订单总金额", DefaultValue = "0", ColumnDataType = "decimal(18,2)", IsNullable = false)]
        public decimal TotalAmount { get; set; }


        /// <summary>
        /// 优惠金额
        /// </summary>
        [SugarColumn(ColumnDescription = "优惠金额", DefaultValue = "0", ColumnDataType = "decimal(18,2)", IsNullable = false)]
        public decimal DiscountAmount { get; set; }


        /// <summary>
        /// 应付金额
        /// </summary>
        [SugarColumn(ColumnDescription = "应付金额", DefaultValue = "0", ColumnDataType = "decimal(18,2)", IsNullable = false)]
        public decimal PayableAmount { get; set; }

        /// <summary>
        /// 实付金额
        /// </summary>
        [SugarColumn(ColumnDescription = "实付金额", DefaultValue = "0", ColumnDataType = "decimal(18,2)", IsNullable = false)]
        public decimal ActualPayAmount { get; set; }

        /// <summary>
        /// 退款金额
        /// </summary>
        [SugarColumn(ColumnDescription = "退款金额", DefaultValue = "0", ColumnDataType = "decimal(18,2)", IsNullable = false)]
        public decimal RefundAmount { get; set; }


        /// <summary>
        /// 订单来源
        /// </summary>
        [SugarColumn(ColumnDescription = "订单来源", IsNullable = true)]
        public OrderSourceEnum OrderSource { get; set; }


        /// <summary>
        /// 订单状态
        /// </summary>
        [SugarColumn(ColumnDescription = "订单状态", DefaultValue = "1", IsNullable = false)]
        public OrderStateEnum OrderState { get; set; }

        /// <summary>
        /// 支付状态
        /// </summary>
        [SugarColumn(ColumnDescription = "支付状态", DefaultValue = "0", IsNullable = false)]
        public OrderPayStateEnum OrderPayState { get; set; }



        /// <summary>
        /// 备注
        /// </summary>
        [SugarColumn(ColumnDescription = "备注", DefaultValue = "", IsNullable = true)]
        [MaxLength(300)]
        public string Remark { get; set; }
    }
}
